import random
str1 = ""
gold = 1000
while gold > 100:
    if str1 == "exit":
        break
    su = 0
    for i in range(3):
        num = random.randrange(1, 7)
        su = su + num

    str1 = input("请输入你认为的大或小:")
    if su >= 11 and str1 == "大":
        gold += 100
        print(f'恭喜你猜对了，你的金豆还有{gold}个')
    elif su < 10 and str1 == "小":
        gold += 100
        print(f'恭喜你猜对了，你的金豆还有{gold}个')
    elif su > 10 and str1 == "小":
        gold -= 100
        print(f'猜错了，你的金豆还有{gold}个')
    elif su < 10 and str1 == "大":
        gold -= 100
        print(f"猜错了，你的金豆还有{gold}个")



